package com.csc.finalproject.domain;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;


/**
 * 
 * @author Nguyen Ngoc Truc Giang
 *
 */
@Entity
@Table(name = "accountinfos")
public class AccountInfo implements  Serializable {
	/**
	 * relationship with State class
	 */
	@ManyToOne
	@JoinColumn(name = "stateId")
	private State state;
	@OneToMany(mappedBy = "accountInfo")
	private List<SavingAccount> savingAccount;

	@OneToMany(mappedBy = "accountInfo")
	private List<DepositeAccount> depositeAccount;

	public List<DepositeAccount> getDepositeAccount() {
		return depositeAccount;
	}

	public void setDepositeAccount(List<DepositeAccount> depositeAccount) {
		this.depositeAccount = depositeAccount;
	}

	/*
	 * attribute
	 */
	@Id
	@Column
	private int accountId;
	@Column
	private String accountNumber;
	@Column
	private String identifyCard;
	@Column
	private String firstName;
	@Column
	private String lastName;
	@Column
	private String midName;
	@Column
	private String phone1;
	@Column
	private String phone2;
	@Column
	private String email1;
	@Column
	private String email2;

	/*
	 * contructor
	 */
	public AccountInfo() {

	}

	public AccountInfo(String accountNumber,
			String indentifyCard, String firstName, String lastName,
			String midName, String phone1, String phone2, String email1,
			String email2) {
		super();
		this.accountNumber = accountNumber;
		this.identifyCard = indentifyCard;
		this.firstName = firstName;
		this.lastName = lastName;
		this.midName = midName;
		this.phone1 = phone1;
		this.phone2 = phone2;
		this.email1 = email1;
		this.email2 = email2;
	}
	public AccountInfo(int accountId, String accountNumber,
			String indentifyCard, String firstName, String lastName,
			String midName, String phone1, String phone2, String email1,
			String email2) {
		super();
		this.accountId = accountId;
		this.accountNumber = accountNumber;
		this.identifyCard = indentifyCard;
		this.firstName = firstName;
		this.lastName = lastName;
		this.midName = midName;
		this.phone1 = phone1;
		this.phone2 = phone2;
		this.email1 = email1;
		this.email2 = email2;
	}
	public AccountInfo(State state, int accountId, String accountNumber, String indentifyCard, String firstName,
			String lastName, String midName, String phone1, String phone2,
			String email1, String email2) {
		super();
		this.state = state;
		this.accountId = accountId;
		this.accountNumber = accountNumber;
		this.identifyCard = indentifyCard;
		this.firstName = firstName;
		this.lastName = lastName;
		this.midName = midName;
		this.phone1 = phone1;
		this.phone2 = phone2;
		this.email1 = email1;
		this.email2 = email2;
	}

	/*
	 * getter/setter
	 */
	public int getAccountId() {
		return accountId;
	}

	public void setAccountId(int accountId) {
		this.accountId = accountId;
	}

	public String getAccountNumber() {
		return accountNumber;
	}

	public void setAccountNumber(String accountNumber) {
		this.accountNumber = accountNumber;
	}

	public String getIdentifyCard() {
		return identifyCard;
	}

	public void setIdentifyCard(String indentifyCard) {
		this.identifyCard = indentifyCard;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getMidName() {
		return midName;
	}

	public void setMidName(String midName) {
		this.midName = midName;
	}

	public String getPhone1() {
		return phone1;
	}

	public void setPhone1(String phone1) {
		this.phone1 = phone1;
	}

	public String getPhone2() {
		return phone2;
	}

	public void setPhone2(String phone2) {
		this.phone2 = phone2;
	}

	public String getEmail1() {
		return email1;
	}

	public void setEmail1(String email1) {
		this.email1 = email1;
	}

	public String getEmail2() {
		return email2;
	}

	public void setEmail2(String email2) {
		this.email2 = email2;
	}

	public State getState() {
		return state;
	}

	public void setState(State state) {
		this.state = state;
	}

}
